package com.ucode.model.hrm.enums;

import com.ucode.tool.base.IntArrayValuable;

import java.util.Arrays;

/**
 * 社保规则分类项
 */
public enum HrmSocialSecurityCoverageTypeEnum implements IntArrayValuable {
    TYEP1(1,"养老"),
    TYEP2(2,"医疗"),
    TYEP3(3,"失业"),
    TYEP4(4,"工伤"),
    TYEP5(5,"生育"),
    TYEP6(6,"大病医疗"),
    TYEP7(7,"残保金"),
    TYEP8(8,"长期照护险");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(HrmSocialSecurityCoverageTypeEnum::getCode).toArray();

    public Integer code;

    public String message;

    HrmSocialSecurityCoverageTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public static HrmSocialSecurityCoverageTypeEnum get(Integer code){
        for(HrmSocialSecurityCoverageTypeEnum dataPermissionType : values()){
            if(dataPermissionType.code == code){
                return dataPermissionType;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}